package com.example.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.springboot.entity.Route;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RouteMapper extends BaseMapper<Route> {
    
    Route selectRouteById(@Param("id") Long id);
    
    IPage<Route> selectRoutesPage(Page<Route> page);
    
    IPage<Route> selectHotRoutes(Page<Route> page);
    
    IPage<Route> selectRoutesByDestination(@Param("destinationId") Long destinationId, Page<Route> page);
    
    IPage<Route> selectRoutesByTheme(@Param("theme") String theme, Page<Route> page);
    
    IPage<Route> selectRoutesByDifficulty(@Param("difficulty") String difficulty, Page<Route> page);
    
    IPage<Route> searchRoutes(@Param("keyword") String keyword, Page<Route> page);
    
    List<Route> selectRelatedRoutes(@Param("destinationId") Long destinationId, @Param("limit") Integer limit);
    
    List<String> selectAllThemes();
}